package com.gientech.group9.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.gientech.group9.model.valid.ApplyRecordSave;
import com.gientech.group9.model.valid.AuditOperation;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;


@Data
@Entity
public class AuditLog {
    @Id
    @GenericGenerator(name="gen",strategy="increment")
    @GeneratedValue(generator="gen")
    @Column(name = "log_id", unique = true, nullable = false, precision = 15, scale = 0)
    private Integer logId;
    private Integer applyId;
    @NotEmpty(groups = ApplyRecordSave.class)
    private String customerName;
    
    private Integer customerId;

    
    private Integer auditorUid;
    private String auditorName;

    @NotNull(groups = AuditOperation.class)
    private Integer status;

    private BigDecimal applyAmount;

    private String memo;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createDate;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date auditDate;

    @Transient
    private String event;


}
